<?php
/**
 * 图集上传demo
 */

//ajax上传处理逻辑，上传产品为例
if ($rec == 'upload_gallery'){
    if ($_FILES['img_url']) {
        $image_name = $img->upload_image('img_url');
        $file_name = $images_dir . $image_name;
        echo $file_name;
    } else {
        echo '';
    }
}

//前端代码获取
$product['gallery'] = $product['gallery']?explode(',',$product['gallery']):false;

//smarty调用代码
//{foreach from=$product.gallery item=gallery}
//<li>
//        <a href="#" target="_blank"><img src="{$site.root_url}{$gallery}" /></a>
//       </li>
//       {/foreach}

